const validator = require('../../../helper/validator')
const createValidation = require('../../../helper/createValidation')
const commonValidation = require('../../../constant/commonValidation')

module.exports = {
  find: [
    ...commonValidation.find,
  ],
  create: [
    createValidation('body.full_name', true, validator.isString),
    createValidation('body.username', false, validator.isString),
    createValidation('body.email', false, validator.isEmail),
    createValidation('body.password', true, validator.isPassword),
    createValidation('body.phone_region', false, validator.isString),
    createValidation('body.phone_number', false, validator.isString),
    createValidation('body.profile_image_url', false, validator.isURL),
    createValidation('body.enabled', false, validator.isBoolean),
  ],
  get: [
    createValidation('params.id', true, validator.isUInt),
  ],
  update: [
    createValidation('params.id', true, validator.isUInt),
  ],
  delete: [
    createValidation('params.id', true, validator.isUInt),
  ],
}
